package no.ntnu.fp.client;

import java.util.logging.Logger;

import javax.swing.JFrame;

import no.ntnu.fp.gui.CommandCentre;
import no.ntnu.fp.gui.LoginWindow;
import no.ntnu.fp.model.Person;
import no.ntnu.fp.server.Server;

public class ClientProgramStart {

	public static ClientProgramStart cps = new ClientProgramStart();
	boolean loggedIn = false;

	public static void main(String[] args) {
		try {
			new Server();
			new ClientConnectionHandler(1502);

			LoginWindow.start();
		} catch (Exception e) {
			System.err.println("Some error was caught at the highest level.");

			e.printStackTrace();
		}
	}

	/**
	 * Login successfull.
	 */
	public void loginOk(Person p) {
		loggedIn = true;
		Person.setCurrentUser(p);
		CommandCentre.start();
	}
}
